package zhishuang.wang.sansi.playlist.entry;

/**
 * @Author Zhishuang.Wang
 * @Date 2023/7/5 11:09
 * @Email 1406110602@qq.com
 */

import zhishuang.wang.sansi.tools.ReturnData;

public class PictureBase {
    private Integer audit;
    private Integer showMode;
    private Integer pictureType;
    private Integer updateCycle;
    private String picturePath;

    public PictureBase() {
    }

    public PictureBase(int pictureType, String picturePath) {
        this.pictureType = pictureType;
        this.picturePath = picturePath;
    }

    public ReturnData checkParam() {
        ReturnData rd = new ReturnData();
        rd.setCode(1);
        String errorMes = "";
        if (this.pictureType != null && this.picturePath != null) {
            if (this.pictureType < 0 || this.pictureType > 2) {
                errorMes = errorMes + "图片类型取值范围： 0 - 2；";
            }

            if (this.showMode != null && (this.showMode < 0 || this.showMode > 2)) {
                errorMes = errorMes + "展示模式取值范围： 0 - 2；";
            }
        } else {
            errorMes = errorMes + "图片类型、图片路径、播放时间等参数必填；";
        }

        if (errorMes != null && errorMes.length() != 0) {
            rd.setMessage(errorMes);
        } else {
            rd.setCode(0);
        }

        return rd;
    }

    public Integer getAudit() {
        return this.audit;
    }

    public void setAudit(Integer audit) {
        this.audit = audit;
    }

    public Integer getShowMode() {
        return this.showMode;
    }

    public void setShowMode(Integer showMode) {
        this.showMode = showMode;
    }

    public Integer getPictureType() {
        return this.pictureType;
    }

    public void setPictureType(Integer pictureType) {
        this.pictureType = pictureType;
    }

    public String getPicturePath() {
        return this.picturePath;
    }

    public void setPicturePath(String picturePath) {
        this.picturePath = picturePath;
    }

    public Integer getUpdateCycle() {
        return this.updateCycle;
    }

    public void setUpdateCycle(Integer updateCycle) {
        this.updateCycle = updateCycle;
    }
}
